ifeq ($(TOP_DIR),)

EXTRA_CFLAGS += -fstack-protector-all

ifeq ($(DAVINCI_HIAI_DKMS),y)
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc/inc
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/libc_sec/include
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcievnic_common_h
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcievnic_host
	ifeq ($(TARGET_PRODUCT),cloud)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	else
		ifeq ($(TARGET_CHIP_ID),$(ASCEND_FLORENCE_DC_V10))
			EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_ESL_FPGA
		else ifeq ($(TARGET_CHIP_ID),hi1910b)

		else
			EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_MINIV1
		endif
	endif
else
	CUR_MAKEFILE_PATH := $(strip \
                $(eval LOCAL_MODULE_MAKEFILE := $$(lastword $$(MAKEFILE_LIST))) \
                $(patsubst %/,%, $(dir $(LOCAL_MODULE_MAKEFILE))) \
                )

	EXTRA_CFLAGS += -I$(CUR_MAKEFILE_PATH)/../../../../drivers/dev_inc
	EXTRA_CFLAGS += -I$(CUR_MAKEFILE_PATH)/../../../../abl/libc_sec/include
	EXTRA_CFLAGS += -I$(CUR_MAKEFILE_PATH)/../../../../drivers/unreleased/pcivnic/pcievnic_common_h
	EXTRA_CFLAGS += -I$(CUR_MAKEFILE_PATH)/../../../../drivers/unreleased/pcivnic/pcievnic_host
	ifeq ($(TARGET_PRODUCT),cloud)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	else
		ifeq ($(TARGET_CHIP_ID),$(ASCEND_FLORENCE_DC_V10))
			EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_ESL_FPGA
		else
			EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_MINIV1
		endif
	endif
endif

ccflags-y += -Wall -Wno-error

obj-m += drv_pcie_vnic_host.o
drv_pcie_vnic_host-objs := pcivnic_main.o pcivnic_host.o pcivnic_init.o

else

EXTRA_CFLAGS += -fstack-protector-all

ifeq ($(DAVINCI_HIAI_DKMS),y)
    EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc_open/inc
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/dev_inc/inc
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/libc_sec/include
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcievnic_common_h
	EXTRA_CFLAGS += -I$(HIAI_DKMS_DIR)/pcievnic_host
	ifeq ($(PRODUCT),ascend910)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif
	ifeq ($(PRODUCT),ascend910B)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
        EXTRA_CFLAGS += -DCFG_FEATURE_SRIOV
	endif
	ifeq ($(PRODUCT),ascend920esl)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif
	ifeq ($(PRODUCT),ascend920emu)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif

	ifeq ($(PRODUCT),ascend310p)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_ESL_FPGA
	endif

	ifeq ($(PRODUCT),ascend310)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_MINIV1
	endif
else
    EXTRA_CFLAGS += -I$(DRIVER_OPEN_KERNEL_DIR)/inc
    EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/inc
    EXTRA_CFLAGS += -I$(TOP_DIR)/abl/libc_sec/include
    EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/unreleased/pcivnic/pcievnic_common_h
    EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/unreleased/pcivnic/pcievnic_host
	ifeq ($(PRODUCT),ascend910)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif
	ifeq ($(PRODUCT),ascend910B)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
        EXTRA_CFLAGS += -DCFG_FEATURE_SRIOV
	endif
	ifeq ($(PRODUCT),ascend920esl)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif
	ifeq ($(PRODUCT),ascend920emu)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_CLOUD_HOST
	endif

	ifeq ($(PRODUCT),ascend310p)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_ESL_FPGA
	endif

	ifeq ($(PRODUCT),ascend310)
		EXTRA_CFLAGS += -DCFG_SOC_PLATFORM_MINIV1
	endif
endif

ccflags-y += -Wall -Wno-error

obj-m += drv_pcie_vnic_host.o
drv_pcie_vnic_host-objs := pcivnic_main.o pcivnic_host.o pcivnic_init.o

endif
